<template>
    <div class="box">
        <div>
            <input v-model="loginForm.username" />
            <input v-model="loginForm.password" type="password" />
            <button @click="Login">登录</button>
        </div>
    </div>
</template>

<script setup lang='ts'>
    import { ref,reactive, VueElement } from 'vue';
    import { login } from '@/request/api/login'


    //登录
    const loginForm = reactive({
        username: '',
        password: ''
    })
    const Login = async () => {
        const data = await login(loginForm)
        console.log(data);
    }


    //自定义事件
    function auto(data:Number) {
        console.log('来自子组件的data',data);
    }
  
    
</script>

<style lang='less' scoped>
    .box {
        border: 1px solid red;
        margin:10px;
    }
</style>